package com.ls.customer.repository;

import com.ls.customer.entity.Customer;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

/**
 * @author 钰杰
 * @className CustomerRepository
 * @description VX:FengYJ996
 * @date 2020/1/28:56
 */
@Repository
public interface CustomerRepository extends JpaRepository<Customer,Integer> {

    Customer findCustomerByAppid(String appid);

    @Modifying
    @Query(nativeQuery = true,value = "UPDATE tb_customer SET balance = ?2 WHERE appid = ?1")
    void updBalanceByAppid(String appid, double resultBalance);
}
